package com.hqj.utils;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * @author 黄啟军
 * @version 1.0
 * @date 2020/7/19 0019
 */
@Component
public class ConstantPropertiesUtils implements InitializingBean {
    @Value("${oss.endpoint}")
    private String endpoint;
    @Value("${oss.access-key}")
    private String keyId;
    @Value("${oss.secret-key}")
    private String keySecret;
    @Value("${oss.bucket}")
    private String bucketName;
    /**定义公开静态常量*/
    public static String END_POIND;
    public static String ACCESS_KEY_ID;
    public static String ACCESS_KEY_SECRET;
    public static String BUCKET_NAME;
    @Override
    public void afterPropertiesSet() throws Exception {
        END_POIND = endpoint;
        ACCESS_KEY_ID = keyId;
        ACCESS_KEY_SECRET = keySecret;
        BUCKET_NAME = bucketName;
    }
}
